﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace KD.Sms.UI
{
    public partial class KdPail : UserControl
    {
        public KdPail()
        {
            InitializeComponent();
        }
        string _strPailName = string.Empty;
        string _strSampleCode = string.Empty;
        string _strPointCount = string.Empty;
        string _strWeight = string.Empty;
        bool _bHavePail = false;

        /// <summary>
        /// 桶号
        /// </summary>
        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Category("Text")]
        [System.ComponentModel.Description("显示文本")]
        [System.ComponentModel.DefaultValue("")]//默认值
        public string C_PailName
        {
            set
            {
                if (_strPailName != value)
                {
                    FormHelper.SetControlText(labName, value);
                    _strPailName = value;
                }
            }
            get { return _strPailName; }
        }

        /// <summary>
        /// 采样编码
        /// </summary>
        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Category("Text")]
        [System.ComponentModel.Description("显示文本")]
        [System.ComponentModel.DefaultValue("")]//默认值
        public string C_SampleCode
        {
            set
            {
                if (_strSampleCode != value)
                {
                    FormHelper.SetControlText(labCode, value);
                    _strSampleCode = value;
                }
            }
            get { return _strSampleCode; }
        }

        /// <summary>
        /// 采样编码
        /// </summary>
        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Category("Text")]
        [System.ComponentModel.Description("显示文本")]
        [System.ComponentModel.DefaultValue("")]//默认值
        public string C_PointCount
        {
            set
            {
                if (_strPointCount != value)
                {
                    FormHelper.SetControlText(labCount, value);
                    _strPointCount = value;
                }
            }
            get { return _strPointCount; }
        }

        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Category("Text")]
        [System.ComponentModel.Description("显示文本")]
        [System.ComponentModel.DefaultValue("")]//默认值
        public string C_Weight
        {
            set
            {
                if (_strWeight != value)
                {
                    FormHelper.SetControlText(labWeight, value.IndexOf("#") >= 0 ? value : ((value == "0" ? "0.00" : value) + "kg"));
                    _strWeight = value;
                }
            }
            get { return _strWeight; }
        }

        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Category("Text")]
        [System.ComponentModel.Description("显示文本")]
        [System.ComponentModel.DefaultValue("")]//默认值
        public bool C_HavePail
        {
            set
            {
                if (_bHavePail != value)
                {
                    FormHelper.SetControlVisable(labCode, value);
                    FormHelper.SetControlVisable(labWeight, value);
                    FormHelper.SetControlVisable(labCount, value);
                    FormHelper.SetGroundImage(panPail, value ? KD.Sms.UI.Properties.Resources.yt2 : KD.Sms.UI.Properties.Resources.ht2);
                    FormHelper.SetControlForeColor(labName, value ? Color.Green : Color.Red);
                    _bHavePail = value;
                }
            }
            get { return _bHavePail; }
        }


    }
}
